<!--
 * @Author: tanlijun 2060803224@qq.com
 * @Date: 2022-11-15 15:32:11
 * @LastEditors: tanlijun 2060803224@qq.com
 * @LastEditTime: 2022-11-15 15:49:27
 * @FilePath: \js基础\js基础第三天\code\循环练习.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>
    // 1.利用for循环输出1-100岁
    // for(let i = 1; i <= 100;i++){
    //   document.write(`${i}<br>`)
    // }

    // 2.求1-100之间的所有的偶数和
    // let sum = 0
    // for (let i = 1; i <= 100; i++) {
    //   if (i % 2 === 0) {
    //     sum = sum + i
    //   }
    // }
    // document.write(`1~100之间的所有的偶数和是：${sum}`)

    // 3.页面中打印5个小星星
    // for(let i = 1; i <= 5;i++){
    //   document.write('☆')
    // }

    // 4.打印倒三角形星星
    for(let i = 1;i <= 5;i++){
      for(j = 1;j <= i;j++){
        document.write(`ζ`)
      }
      document.write(`<br>`)
    }
  </script>
</body>

</html>